<?php
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
    protected function _initDb()
    {
        // Setup database
        $db = Zend_Db::factory('Pdo_Mysql', $this->getOption('db'));
        $db->setFetchMode(Zend_Db::FETCH_ASSOC);
       
        Zend_Registry::set('DB',$db);
        //Khi thiet lap che do nay model moi co the su dung duoc
        Zend_Db_Table::setDefaultAdapter($db);
        // Return it, so that it can be stored by the bootstrap
        return $db;
    }
    protected function _initStartSession()
    {
        Zend_Session::start();
    }
    protected function _initLocale()
    {
        $locale = new Zend_Locale(Zend_Locale::BROWSER);
        Zend_Registry::set(H_G::T_LOCALE, $locale);
    }
    protected function _initView(){     
        $view = new H_View();
        $viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer();
        $viewRenderer->setView($view);
        Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
        Zend_Registry::set("ZEND_VIEW_KEY", $view);
    }
    protected function _initConfigLang(){
        $lang = $this->getOption('languages');
        H_G::$DEFAULT_LANG = $lang['default'];
    }
    
}

